package org.eking.bigdata.hadoop;

import java.io.IOException;

import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reporter;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;;
public class TestMap extends Mapper<LongWritable, Text,Text, IntWritable>{

	public void map(LongWritable InKey, Text InValue, Context context)
			throws IOException {
		// 
		String OrgStr = InValue.toString();
		String[] SplitString = OrgStr.split(" ");
		String strArea = SplitString[0];
		String strYear = SplitString[1];
		String strTemp = SplitString[2];
		int iTemp = Integer.parseInt(strTemp);
		try {
			context.write(new Text(strArea), new IntWritable(iTemp));
		} catch (InterruptedException e) {
			// 
			e.printStackTrace();
		}
		
	}
}
